package com.zelix;

import java.io.*;
import java.util.HashMap;
import java.util.Vector;
import java.util.zip.*;

public class ay {

    private xx a;
    private Vector b;
    private boolean c;
    private String d;
    private static String z;

    public ay(ZipFile zipfile, ZipEntry zipentry)
            throws IOException, rb {
        InputStream inputstream;
        BufferedReader bufferedreader;

        b = new Vector();
        inputstream = null;
        bufferedreader = null;
        d = zipfile.getName();
        c = zipentry.getMethod() == 8;
        boolean flag;
        try {
            inputstream = zipfile.getInputStream(zipentry);
            bufferedreader = oc.a(inputstream);
            a = new xx(bufferedreader);
            flag = a.b();
            do {
                wx wx1 = new wx(bufferedreader);
                if (!wx1.a())
                    b.addElement(wx1);
                flag = wx1.b();
            } while (!flag);
        } finally {
            if (bufferedreader != null) {
                try {
                    bufferedreader.close();
                }
                catch (IOException ioexception) {
                }
            }
            if (inputstream != null)
                try {
                    inputstream.close();
                }
                catch (IOException ioexception1) {
                }
        }
    }

    public boolean a() {
        return a.c();
    }

    public boolean b()
            throws rb {
        return a.d();
    }

    public boolean c() {
        return c;
    }

    public void a(String s, HashMap hashmap, HashMap hashmap1) {
        int i;
        a.a(s, hashmap, hashmap1);
        for (i = 0; i < b.size(); i++) {
            wx wx1 = (wx) b.elementAt(i);
            wx1.a(s, hashmap);
        }
    }

    public void a(ZipOutputStream zipoutputstream, ly ly, ly ly1, yx yx1, boolean flag)
            throws IOException {
        rc rc1;
        PrintWriter printwriter;
        int i;
        rc1 = new rc(zipoutputstream, z, flag);
        printwriter = new PrintWriter(rc1.a());
        a.a(printwriter, ly, ly1, yx1);
        for (i = 0; i < b.size(); i++) {
            wx wx1 = (wx) b.elementAt(i);
            wx1.a(printwriter, ly, ly1, yx1);
        }
        printwriter.println();
        printwriter.flush();
        rc1.b();
    }

    private static String z(char[] chs) {
        for (int i = 0; i < chs.length; i++) {
            byte key = 0;
            switch (i % 5) {
                case 0: // '\0'
                    key = 0x28;
                    break;

                case 1: // '\001'
                    key = 107;
                    break;

                case 2: // '\002'
                    key = 50;
                    break;

                case 3: // '\003'
                    key = 81;
                    break;

                default:
                    key = 79;
                    break;
            }
            chs[i] ^= key;
        }
        return new String(chs).intern();
    }

    static {
        z = z("e.f\020ba%t~\002i%{\027\n{?\034\034\t".toCharArray());
    }
}